import request from '../utils/request'
import Shop from '../../config/shop'
const baseUrlApi = Shop.BASE_URL
const home = {
  // 翻译的api接口
  chineseToEnglish: (obj) => request.get('/dict', obj, {
    baseURL: 'http://dict.qq.com'
  }),
  // 登录
  Login: (obj) => request.post('/applet/login', obj, {
    baseURL: baseUrlApi
  }),
  // 登录
  phoneLogin: (obj) => request.post('/applet/phoneLogin', obj, {
    baseURL: baseUrlApi
  }),
  // 获取客户通知列表
  getCustomerInform: (obj) => request.post('/applet/customer/inform/list', obj, {
    baseURL: baseUrlApi
  }),
  // 消息 /applet/customer/inform/page 上一条下一条
  getInformPrevOrNext: (obj) => request.post('/applet/customer/inform/page', obj, {
    baseURL: baseUrlApi
  }),
  // 到货通知接口 /applet/customer/inform/add
  addInform: (obj) => request.post('/applet/customer/inform/add', obj, {
    baseURL: baseUrlApi
  }),
  getCustomerInformId: (obj) => request.post('/applet/customer/inform/name', obj, {
    baseURL: baseUrlApi
  }),
  // 获取客户通知列表
  getCustomerInformChange: (obj) => request.post('/applet/customer/inform/change', obj, {
    baseURL: baseUrlApi
  }),
  // 获取供应商列表
  getSupplierList: (obj) => request.post('/applet/buy/storage/supplier/list', obj, {
    baseURL: baseUrlApi
  }),
  // 获取仓库列表
  getWarehouseList: (obj) => request.post('/applet/buy/storage/warehouse/list', {
    status: 0
  }, {
    baseURL: baseUrlApi
  }),
  // 皮带类型和等级
  getBeltLevel: (obj) => request.post('/applet/buy/storage/sysDictType/list', obj, {
    baseURL: baseUrlApi
  }),
  // 获取商品名称
  getGoodsName: (obj) => request.post('/applet/buy/storage/goodsName', obj, {
    baseURL: baseUrlApi
  }),
  // 获取入库列表
  // getInStockList: (obj) => request.post('/applet/buy/storage/list', obj, {
  //   baseURL: baseUrlApi
  // }),
  // 草稿箱list applet/buy/storage/storage/list
  getDraftList: (obj) => request.post('/applet/buy/storage/storage/list', obj, {
    baseURL: baseUrlApi
  }),
  // 批量删除草稿箱
  deteleDraftListBatch: (obj) => request.post('/applet/buy/storage/batchRemove', obj, {
    baseURL: baseUrlApi
  }),
  // 单个删除草稿箱
  deteleDraftListSingle: (obj) => request.post('/applet/buy/storage/remove', obj, {
    baseURL: baseUrlApi
  }),
  // 获取单个入库详情
  getInStockListId: (obj) => request.post('/applet/buy/storage/name', obj, {
    baseURL: baseUrlApi
  }),
  // 新增到草稿箱
  addInStock: (obj) => request.post('/applet/buy/storage/add', obj, {
    baseURL: baseUrlApi
  }),
  // 新增提交 applet/buy/storage/submit/list
  getInStockList: (obj) => request.post('/applet/buy/storage/submit/list', obj, {
    baseURL: baseUrlApi
  }),
  // 新增入库列表
  editInStock: (obj) => request.post('/applet/buy/storage/edit', obj, {
    baseURL: baseUrlApi
  }),
  // 销售订单列表
  saleOrderList: (obj) => request.post('/applet/sale/order/list', obj, {
    baseURL: baseUrlApi
  }),
  getSaleOrderById: (obj) => request.post('/applet/sale/order', obj, {
    baseURL: baseUrlApi
  }),
  // applet/logistics/logisticsManage/saleOrder/list 选择销售单 140
  logisticsSaleOrderList: (obj) => request.post('/applet/logistics/logisticsManage/saleOrder/list', obj, {
    baseURL: baseUrlApi
  }),
  // 新增销售订单列表
  addSaleOrderList: (obj) => request.post('/applet/sale/order/add', obj, {
    baseURL: baseUrlApi
  }),
  // 修改销售订单列表
  editSaleOrderList: (obj) => request.post('/applet/sale/order/edit', obj, {
    baseURL: baseUrlApi
  }),
  // 获取商品列表
  selectGoods: (obj) => request.post('/applet/sale/order/goods/list', obj, {
    baseURL: baseUrlApi
  }),
  // 客户列表
  getCustomerList: (obj) => request.post('/applet/sale/order/customer/list', obj, {
    baseURL: baseUrlApi
  }),
  // 物流追踪列表
  getLogisticsTraceList: (obj) => request.post('/applet/logistics/logisticsManage/trace', obj, {
    baseURL: baseUrlApi
  }),
  //物流确认与否
  affirmLogistics: (obj) => request.post('/applet/logistics/logisticsManage/affirm', obj, {
    baseURL: baseUrlApi
  }),
  // 物流管理列表
  getLogisticsList: (obj) => request.post('/applet/logistics/logisticsManage/list', obj, {
    baseURL: baseUrlApi
  }),
  // 物流管理列表详情
  getLogisticsListId: (obj) => request.post('/applet/logistics/logisticsManage', obj, {
    baseURL: baseUrlApi
  }),
  // 新增物流单号 /logistics/logisticsManage/add
  addLogistics: (obj) => request.post('/applet/logistics/logisticsManage/add', obj, {
    baseURL: baseUrlApi
  }),
  batchIssueLogistics: (obj) => request.post('/applet/logistics/logisticsManage/batchIssue', obj, {
    baseURL: baseUrlApi
  }),
  // applet/sale/order/manage/list 物流单号列表
  getLogisicOrder: (obj) => request.post('/applet/sale/order/manage/list', obj, {
    baseURL: baseUrlApi
  }),
  editLogisticsManageList: obj => request.post('applet/logistics/logisticsManage/edit', obj, {
    baseURL: baseUrlApi
  }),
  saveLogisticsManageList: obj => request.post('applet/logistics/logisticsManage/save', obj, {
    baseURL: baseUrlApi
  }),
  // 解密手机号
  getPhoneNumber: (obj) => request.post('/applet/getPhoneNumber', obj, {
    baseURL: baseUrlApi
  }),
  // 1.2.1、获取拆分单列表接口 左边
  getProductList: (obj) => request.post('/applet/ware/productSplit/productList', obj, {
    baseURL: baseUrlApi
  }),
  getProductListId: (obj) => request.post('/applet/ware/productSplit/editGoods', obj, {
    baseURL: baseUrlApi
  }),
  getProductListIdNotSplit: (obj) => request.post('/applet/ware/productSplit/edit', obj, {
    baseURL: baseUrlApi
  }),
  // 右边
  getSplitList: (obj) => request.post('/applet/ware/productSplit/splitList', obj, {
    baseURL: baseUrlApi
  }),
  getSplitListId: (obj) => request.post('/applet/ware/productSplit/edit', obj, {
    baseURL: baseUrlApi
  }),
  // 库存管理列表接口 applet/stock/logs/goods/list
  getLogGoodsWare: (obj) => request.post('applet/stock/inquiry/list', obj, {
    baseURL: baseUrlApi
  }),
  // 库存管理详情接口
  getLogGoodsWareDetail: (obj) => request.post('applet/stock/inquiry/detail', obj, {
    baseURL: baseUrlApi
  }),
  // 1.拆分管理保存拆分接口
  splitSave: (obj, url) => request.post(`/applet/ware/productSplit${url}`, obj, {
    baseURL: baseUrlApi
  }),
  // 1.拆分管理确认拆分接口
  splitSaveSave: (obj) => request.post('/applet/ware/productSplit/splitSave', obj, {
    baseURL: baseUrlApi
  }),
  // 1.生产管理确认拆分接口
  splitSaveEdit: (obj) => request.post('/applet/ware/productSplit/editSave', obj, {
    baseURL: baseUrlApi
  }),
  // 生产管理保存拆分接口
  splitSaveSaveEdit: (obj) => request.post('/applet/ware/productSplit/productSplitSave', obj, {
    baseURL: baseUrlApi
  }),
  // 1.1.8、生产管理确认拆分接口
  splitSaveConfirm: (obj) => request.post('/applet/ware/productSplit/productSplitSave', obj, {
    baseURL: baseUrlApi
  }),
  getGoodId: (obj) => request.post('/applet/sale/order/good', obj, {
    baseURL: baseUrlApi
  }),
  // 库存管理列表applet/stock/logs/list
  getStockLogs: (obj) => request.post('/applet/stock/logs/list', obj, {
    baseURL: baseUrlApi
  }),
  // 获取车间人员列表
  getCarUser: (obj) => request.post('/applet/logistics/logisticsManage/user/list', obj, {
    baseURL: baseUrlApi
  }),
  // 获取采购区域
  getBuyArea: (obj) => request.post('/applet/sale/order/basBuyArea/list', obj, {
    baseURL: baseUrlApi
  }),
  uploadImg: (obj) => request.post('/common/upload', obj, {
    baseURL: baseUrlApi
  }),
  // 获取富文本
  getShopRich: (id, type) => request.get('imageInfo/selectRichText', {
    businessId: id,
    type: type
  }, {
    baseURL: baseUrlApi
  }),
  // 用户登录
  doLogin: (obj) => request.post('/user/login', {
    code: obj.code,
    id: obj.id,
    userId: obj.userId,
    fromWay: obj.fromWay
  }, {
    baseURL: baseUrlApi
  }),
  judgeUser: () => request.get('/minapp/userSalesman/getSelfInfo', {}, {
    baseURL: baseUrlApi
  }),
  // 获取用户
  getUser: () => request.get('/user/findOne', {}, {
    baseURL: baseUrlApi
  }),
  // 更新昵称、头像、地区、性别
  updateUser: (info) => request.post('/user/update', {
    avatarUrl: info.avatarUrl,
    city: info.city,
    country: info.country,
    gender: info.gender,
    language: info.language,
    nickName: info.nickName,
    province: info.province,
    unionId: info.unionId
  }, {
    baseURL: baseUrlApi
  })
}

export default home
